<?php

/**
 * Talonario form base class.
 *
 * @method Talonario getObject() Returns the current form's model object
 *
 * @package    courier
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseTalonarioForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'tal_id'      => new sfWidgetFormInputHidden(),
      'tal_url'     => new sfWidgetFormInputText(),
      'tal_factura' => new sfWidgetFormPropelChoice(array('model' => 'Factura', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'tal_id'      => new sfValidatorChoice(array('choices' => array($this->getObject()->getTalId()), 'empty_value' => $this->getObject()->getTalId(), 'required' => false)),
      'tal_url'     => new sfValidatorString(array('max_length' => 200)),
      'tal_factura' => new sfValidatorPropelChoice(array('model' => 'Factura', 'column' => 'fac_id')),
    ));

    $this->widgetSchema->setNameFormat('talonario[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Talonario';
  }


}
